﻿using System;

namespace Smart.Hotfix
{
	public interface IUpdateSystem : ISystem
	{

	}

    public interface IUpdate
    {
        void Run(object o);
    }

    public interface IComponentUpdate
    {
        void Update();
    }

    public class UpdateSystem<T> : IUpdate, IUpdateSystem where T : IComponentUpdate
	{
		public void Run(object o)
		{
			if(o is T component)
			{
				component.Update();
			}
		}

		public Type Type()
		{
			return typeof(T);
		}
	}
}
